home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
doom
/
turric03.zip
/
TURRIC03.ZIP
/
PROGS
/
M-TEMPLA.QC
< prev
next >
Wrap
Text File
|
1997-01-30
|
4KB
|
109 lines
/// This is a template for adding a new morph.
///
/// Complete the fields you want to change from the base player
///
/// Add appropriate pre-caching for any sounds/models you use in this morph
///
/// Then add some way (an item, impulse, or anything else) to call
/// player_XXX_become
///
/// The various fields you can set are:
/// Functions:
///
/// _stand: We want to show the standing animation
/// _run: We want to show the running/moving animation
/// (You could check if the vlen(self.velocity) is large or small,
/// and show either a running animation or a walking animation,
/// since both are present in many monsters)
/// _pain: We just got hurt. Maybe show a pain animation, make a sound, ...
/// _jump, _jump2: Player pressed the jump button. Checks (in water, on ground)
/// are _not_ made before _jump is called, but are made before _jump2 is
/// called. _jump2 is not called if _jump is not SUB_Null.
/// _attack: time > self.attack_finished and we are pressing fire
/// show attack animation, fire projectiles, set self.attack_finished
/// Maybe check self.weapon, which can be set from _impulse
/// _impulse: An impulse command from 1..9 was pressed. Switch weapon or do
/// whatever else is appropriate
/// _can_get_p: Return true if player can get the item, or false if not.
/// Note that 'self' is _not_ the player in _can_get_p.
/// SUB_True and SUB_False can be used here.
/// Currently, morphed players can _always_ get health
/// Return 0 for 'not get', return 1 for 'can get'.
/// In the case of ammo, return '2' for 'get, but don't update weapon'
/// (I should add SUB_get_powerups/SUB_get_ammo, ...
/// Or maybe make a bitfield, FL_GET_AMMO, FL_GET_WEAPON, ... ?)
/// _killmsg, _killmsg2: Return the message that should be printed,
/// similarly to the code in client.qc. Again, self is not player
///
/// SUB_Null means to use the default player action,
/// SUB_Nop means that the action does nothing (such as jump for the zombie)
///
///
/// Variables:
/// modelindex_morph: setmodel to the new model for player, then
/// self.modelindex_morph=self.modelindex
/// weaponmode, view_ofs: regular meaning
/// health_modifier: the amount that health should be divided by when
/// changing to another morph. Generally, you multiply by this
/// same number when becoming that morph
///
/// Call DropBackpack2() if it is inappropriate for the player to carry
/// ammo in his new morph
///
/// If it's necessary to add a new behaviours, make sure you amend
/// the other player_*_become() to set it back the way it was
void() player_template_become = {
//** PATCH_BEGIN - morph2 - Turrican ****
// bprint(self.netname);
// bprint(" has become a template.\n");
sprint( self, "You have become a template.\n");
// Stop the morph from flying.
if (self.flags & FL_FLY)
{
localcmd("fly");
self.flags = self.flags - FL_FLY;
}
self._die = player_template_die;
//** PATCH_END - morph2 - Turrican ******
self._stand=player_template_stand;
self._run=player_template_run;
self._pain=player_template_pain;
self._jump=player_template_jump;
self._jump2=player_template_jump2;
self._attack=player_template_attack;
self._impulse=player_template_impulse;
self._can_get_p=player_template_can_get_p;
self._killmsg=player_template_killmsg;
self._killmsg2=player_template_killmsg2;
setmodel(self,"progs/template.mdl");
self.modelindex_morph=self.modelindex;
self.weaponmodel="";
self.view_ofs = '0 0 22';
if(!deathmatch) setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
else setsize (self, '-16 -16 -24', '16 16 40');
self.health = self.health * 0.75 / self.health_modifier;
self.health_modifier = 0.75;
makevectors(self.v_angle);
spawn_tfog(self.origin + 20 * v_forward);
DropBackpack2();
//** PATCH_BEGIN - morph2 - Turrican ****
// Make morphs ignore player colors.
if (self.colormap != 0)
{
self.temp_colormap = self.colormap;
self.colormap = 0;
}
// Make morphs ignore player skins.
if (self.skin != 0)
{
self.temp_skin = self.skin;
self.skin = 0;
}
self.currentammo=0;
self.weapon=IT_AXE;
//** PATCH_END - morph2 - Turrican ******
};